/**
 * 分离style属性
 * @param style 组件的style属性
 * @returns 外层的style属性、内层的style属性
 */
export default function (style: any) {
  const {
    width,
    height,
    minWidth,
    minHeight,
    margin,
    marginLeft,
    marginTop,
    marginRight,
    marginBottom,
    left,
    right,
    top,
    bottom,
    position,
    ...oldStyle
  } = style || {};

  return [
    {
      width,
      height,
      minWidth,
      minHeight,
      margin,
      marginLeft,
      marginTop,
      marginRight,
      marginBottom,
      left,
      right,
      top,
      bottom,
      position,
    },
    {
      width,
      height,
      ...oldStyle
    },
  ];
}
